package cn.iocoder.yudao.module.erp.dal.mysql.business.produce.producework;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.business.produce.producework.vo.ProduceWorkPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.business.produce.producework.ProduceWorkDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 工作中心 Mapper
 *
 * @author yy
 */
@Mapper
public interface ProduceWorkMapper extends BaseMapperX<ProduceWorkDO> {

    default PageResult<ProduceWorkDO> selectPage(ProduceWorkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProduceWorkDO>()
                .likeIfPresent(ProduceWorkDO::getName, reqVO.getName())
                .eqIfPresent(ProduceWorkDO::getCode, reqVO.getCode())
                .betweenIfPresent(ProduceWorkDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProduceWorkDO::getId));
    }

}